home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-10-25 | 766 b | 37 lines | [UVtx/UVtl] |
- // LogoMation is used in Yale University's CS110B course.
- // This program demonstrates a fractal. Many thanks for
- // the course teacher, Prof. Lenore D. Zuck, for her kind
- // permission to include the program in this release (Ed.)
-
- unit = 225
- x1 = -100
- y1 = -65
- prec = 6
- Clear 65535,65435,52609
-
- Up
- Goto x1,y1,0
- Down
- fractal(unit,prec)
-
- ////////////////////////////////////////
-
- Function fractal(unit,prec)
- Fill 2,65535,23270,4813
- Repeat 3
- tri_line(unit,prec)
- Left 120
-
- Function tri_line(unit,prec)
- If unit < prec
- Forward unit
- Else
- unit = unit/3
- tri_line(unit,prec)
- Right 60
- tri_line(unit,prec)
- Left 120
- tri_line(unit,prec)
- Right 60
- tri_line(unit,prec)
-